<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

//新闻资讯
Route::get('news-<id>', '\app\front\controller\Index@newsDetail')->ext('html');
//首页
Route::rule('/v1/pay', '\app\front\controller\Pay@pay');
Route::rule('/alipay/return', '\app\front\controller\Pay@alipayReturn');
Route::rule('wx_callback', '\app\front\controller\Pay@wxCallback');
Route::rule('alipay_callback', '\app\front\controller\Pay@alipayCallback');
Route::rule('api/check_pay_status', '\app\front\controller\Pay@checkPayStatus');
Route::rule('report/<order_no>', '\app\front\controller\Index@reportDetail')->ext('html');

Route::get('/', '\app\front\controller\Index@index');
//问答
Route::rule('question', '\app\front\controller\Index@question');
Route::rule('get_question', '\app\front\controller\Index@getQuestion');
//提交
Route::rule('report', '\app\front\controller\Index@report');
Route::rule('results', '\app\front\controller\Index@result');


Route::group('admins', function () {
    Route::rule('reports/edit', '\app\admin\controller\Topic@reportsEdit');
    Route::rule('reports', '\app\admin\controller\Topic@reports');
    Route::rule('upload', '\app\admin\controller\Index@upload');
    Route::rule('index', '\app\admin\controller\Index@index');

    //题目管理
    Route::group("topic",function (){
        //题目列表
        Route::get('', '\app\admin\controller\Topic@show');
        //题目编辑
        Route::rule('edit', '\app\admin\controller\Topic@edit');
    });
    //资讯管理
    Route::group("news",function (){
        //题目列表
        Route::rule('', '\app\admin\controller\Topic@news');
        //资讯添加
        Route::rule('add', '\app\admin\controller\Topic@newsAdd');
        //资讯编辑
        Route::rule('edit', '\app\admin\controller\Topic@newsEdit');
        //资讯删除
        Route::rule('delete', '\app\admin\controller\Topic@newsDelete');
        Route::rule('in_delete', '\app\admin\controller\Topic@in_delete');
    });
    //配置列表
    Route::rule('conf', '\app\admin\controller\Conf@index');

})->middleware(\app\middleware\Check::class);

Route::rule('admins/logout', '\app\admin\controller\Index@logout');
Route::rule('admins/login', '\app\admin\controller\Index@login');
